home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 001a / tlxjwpc5.zip / RECORDER.SLT < prev    next >
Text File  |  1991-10-11  |  3KB  |  65 lines

  1. // JW-PC Telix 3.12 script 10-11-91
  2. // For use to store data dumped from a data recorder via serial port.
  3. //
  4. // Script will:  Close any existing capture file, set port and parameters
  5. // for Com1,9600,n,8,1, opens new capture file via user input,
  6. // and notifies user to begin or warns of error condition.
  7. // User should edit capture path as needed or delete line if
  8. // default capture path is correct.
  9. //
  10. // Compile script with CS.
  11. //
  12. // Script originally set to capture data from a Nikon DR2 data recorder
  13. //
  14. main() { if (capture_stat() != 0)           //If we have a capture file
  15.      {                                      //already open or paused,
  16. capture("*CLOSE*");                         //close it.
  17.      }
  18. str cap_dir[64]="d:\data\plan\";            //Put your capture path here
  19. str message[80]; str s[1];
  20. str cap_name[12];                           //Buffer for filename
  21. str dat[8];
  22. int save;
  23. int key;
  24. int i;
  25. int atest;                                  //Default
  26. int stest;                                  //   system
  27. atest=_alarm_on;                            //       settings
  28. stest=_sound_on;                            //           storage for alarm
  29. set_port(1);                                //Use Com1
  30. set_cparams(9600, 0, 8, 1);                 //Set cfg to 9600,N,8,1
  31. set_terminal("tty");                        //Use TTY terminal
  32. save=vsavearea(10,10,66,13);                //Save the screen...
  33. box(10,10,66,13,2,0,31);                    //Draw box, ask the question...
  34. pstraxy("  Enter the filename to save DR2 data into: ",15,11,30);
  35. pstraxy("              ________                      ",20,12,30);
  36. gotoxy(34, 12);
  37. gets(cap_name, 8);                          //Process the response
  38. vrstrarea(save);                            //Restore the screen...
  39. strcat(cap_name,".DR2");                    //Add ext to cap_name
  40. strcat(cap_dir,cap_name);                   //Put path in front of cap_name
  41. strupper(cap_dir);                          //Make it all caps
  42. if (capture(cap_dir) == -1)                 //Try to open capture file,
  43.    {                                        //if error, construct message...
  44.    strcat(message,"ERROR in opening ");
  45.    strcat(message,cap_dir);
  46.    strcat(message," capture file.");
  47.    _alarm_on=1;
  48.    _sound_on=1;
  49.    alarm(1);                                //beep notification
  50.    status_wind(message, 60);                //print message
  51.    _alarm_on=atest;
  52.    _sound_on=stest;
  53.    }
  54.    else
  55.       {                                     //if OK, construct messages...
  56.       strcat(message,"Capture file ");
  57.       strcat(message,cap_dir);
  58.       strcat(message," successfully opened.");
  59.       status_wind(message, 20);             //print message
  60.       delchrs(message, 0, 80);
  61.       strcat(message," Begin Data Recorder dump session now.");
  62.       status_wind(message, 60);             //print message
  63.       }
  64. }
  65.